from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need
# fine tuning.
# 使用 python setup.py build 命令启动生成exe

import sys
import os.path

PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')

base = 'Win32GUI' if sys.platform == 'win32' else None
includes = []
include_files = [
    os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
    os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
    'qrcoder.ico',
]
executables = [
    Executable('main.py', targetName="QRCoder.exe", base=base, icon="qrcoder.ico")
]

setup(name='QRCoder', version='1.0', description='二维码生成器',
      options={"build_exe": {"includes": includes, "include_files": include_files}},
      executables=executables, requires=['qrcode'])
